package com.winsafe.basescan;

import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.winsafe.scanlibrary.base.BaseScanFragment;

public class TwoFragment extends BaseScanFragment {

    private TextView tv_result;
    private StringBuilder resultStr;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        View inflate = inflater.inflate(R.layout.fragment_scan, container, false);

        tv_result = inflate.findViewById(R.id.tv_result);
        resultStr = new StringBuilder();
        return inflate;
    }

    @Override
    protected void onScanResult(String idCode) {
        Log.e("TwoFragment", idCode);
        resultStr.append(idCode).append("\n");
        tv_result.setText(resultStr);
    }
}